package com.mframe.activiti.task;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

public class AuditorTaksListener implements TaskListener {

	private static final long serialVersionUID = 1L;

	
	@Override
	public void notify(DelegateTask delegateTask) {
		String processInstanceId = delegateTask.getProcessInstanceId();
		int pid = Integer.parseInt(processInstanceId);
		DelegateExecution execution = delegateTask.getExecution();
		System.err.println("流程pid：" + pid);
		System.err.println("流程实例总数：" + execution.getVariable("nrOfInstances"));
		System.err.println("当前活动的流程实例总数：" + execution.getVariable("nrOfActiveInstances"));
		System.err.println("已经完成实例的数目：" + execution.getVariable("nrOfCompletedInstances"));
		System.err.println("leader：" + execution.getVariable("leader"));
		System.err.println("---------------------------------------分隔线----------------------------------------------------");
	}
}
